class Test(object):
    def __init__(self):
        self.__num=100
        # 当在变量前添加两个__时表示变量私有化，在外部不能直接访问 
    
    def setNum(self,newNum):
        self.__num=newNum;
    
    def getNum(self):
        return self.__num;
    
    num=property(getNum,setNum)
    
if __name__ == "__main__":
    t= Test()
    print(t.getNum());
    t.setNum(10);
    print(t.getNum());
    print(t.num)
    t.num=100
    print(t.num)